package com.zxl.pojo;

import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.annotations.ApiModelProperty;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.NotBlank;

import java.util.Date;

@Setter
@ToString
public class User {
    public interface UserSimpleView {
    }

    public interface UserDetailView extends UserSimpleView {
    }

    private Integer id;
    @ApiModelProperty("用户名")
    private String username;
    @NotBlank
    private String password;
    private String headImg;
    private Date birth;

    @JsonView(UserDetailView.class)
    public Integer getId() {
        return id;
    }

    @JsonView(UserSimpleView.class)
    public String getUsername() {
        return username;
    }

    @JsonView(UserDetailView.class)
    public String getPassword() {
        return password;
    }

    public String getHeadImg() {
        return headImg;
    }
}
